package jugadores;


import cartas.Naipe;
import cartas.mazo;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import tute.CombinationGenerator;
import tute.CombinationHelper;

public class Maquina extends Jugador {

    public Maquina(String nombre)  {
       super(nombre);

    }

    public Maquina(mazo deck, mazo compHand, Naipe vida, mazo inPlay) {
        super("");
       
        

    }
    public void setChoice (int choice ){
        
        this.ai_choice=choice;
    }
    
    public Naipe  jugar(mazo deck,Naipe vida, mazo inPlay){
       

          /* CombinationHelper helper = new CombinationHelper();
           ArrayList<mazo> combinations = helper.getCombinations(deck, 3);
           
           double [] probability = helper.CardVsCombinations(juego, combinations, vida.nombreFlor());
           
           double max=0;
           int    max_selection=0;
           for (int i=0;i<probability.length;i++){
               if(max>probability[i]){
                   max=probability[i];
                   max_selection=i;
               }
               
               
           }
           
           return juego.getNaipe(max_selection);
           */
           // ai_choice = 0;

            //GameAI cpu_game = new GameAI(deck, juego, vida, inPlay, this);
            //cpu_game.run();
            //Thread cpu_decision = new Thread(cpu_game);
            //long time1= System.currentTimeMillis();
           // cpu_decision.start();
            
            
            //long time2= System.currentTimeMillis();
           // System.out.println(time2-time1);


            //System.out.println("El choice fue " + ai_choice);

            return juego.getNaipe((int)Math.random()*3);
        
        
       
     
    
    
    }

    
     // private fields 
    public  int ai_choice;
    
    
}
